package com.example.hcbmsm.controller;

import com.example.hcbmsm.domain.Pat;
import com.example.hcbmsm.service.PatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Xinghm
 * @version 1.0
 * @since 2024/10/29 18:48
 */
@RestController
@CrossOrigin
@RequestMapping("/pat")
public class PatController {
    @Autowired
    private PatService patService;
    @PostMapping("/register")
    public Map register(Pat Pat) {
        return patService.register(Pat);
    }
    @PostMapping("/getUser")
    public Map getUser(String token) {
        return patService.getUser(token);
    }
    @PostMapping("/update")
    public Map update(Pat pat) {
        return patService.update(pat);
    }
}
